package org.springblade;

import org.springblade.modules.system.service.IParamService;
import org.springblade.modules.task.service.IJobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class ServletInitializer implements ApplicationRunner {
    @Autowired
    private IJobService jobService;
    @Autowired
    private IParamService paramService;


    @Override
    public void run(ApplicationArguments args) throws Exception {
        System.out.println("执行启动任务");
        //  初始化定时任务
        jobService.startAllTask();
        // 初始化配置参数
        paramService.initParam();

    }

}
